import numpy as np


def modTest():
    h, w = 2500, 1666
    ratio = 640 / 2500
    nh = h * ratio  # 640
    nhm = np.mod(nh, 32)  # 取模=0

    nw = w * ratio  # 426
    r = np.mod(w * ratio, 32)  # 取模=10（非32的整数倍）
    nw += 32 - r  # 加上32-r变为32的整数倍
    nwm = np.mod(nw, 32)  # 取模=0

    print(nh)
    print(nhm)
    print(nw)
    print(nwm)


def ascontiguousarrayTest():
    arr = np.arange(12).reshape(3, 4)
    flags = arr.flags
    print("", arr)
    print(flags)


if __name__ == '__main__':
    # ascontiguousarrayTest()
    modTest()
